
#ifndef GRAPHICS_
#define GRAPHICS_

#include "APIInterface.h"
#include "image.h"


class Graphics2D
{

public:
	static char* DEFAULT_PS_SHADER;
	static char* DEFAULT_VS_SHADER;

	ID3D11ShaderResourceView* colorMap_; // this is the texture
	ID3D11SamplerState* colorMapSampler_; // this is the sampler to be aplied on the texture

	Graphics2D();

	void setClearColor(const float* newColor);

	void Initialize(DirectXInterface* directXInterface);
	
	void LoadTexture(const char* filePath, Image* image); // this will use some default shaders, who do nothing with the image.

	// WARINING: Use the default function VS_Main for Vertex Shader and PS_Main for Pixel Shader.
	void LoadTexture(const char* imagePath, const char* vertexShaderPath, const char* pixelShaderPath, Image* image);
	
	void Draw(Image* image, XMFLOAT2 pos);
	void Begin();
	void End();


protected:
	const float* clearColor;
	D3D11_BUFFER_DESC* vertexDesc;
	unsigned int verticesCount;
	DirectXInterface* directxInterface;
	
	void LoadShader(const char* vertexShaderPath, const char* pixelShaderPath, ID3D11VertexShader** vetexShaderInfo, 
		ID3D11PixelShader** pixelShaderInfo, ID3D11InputLayout** inputLayout);
};

#endif